package com.attilax.exception;

import java.io.PrintWriter;
import java.io.StringWriter;

public class ExUtil {
	public static void throwEx(Throwable e) {
		 if( e instanceof RuntimeException)
			  throw (RuntimeException)e;
		  else
			  throw new RuntimeException(e);
		
	}
	 public static String getTrace(Throwable t) {
		 try {
			 StringWriter stringWriter= new StringWriter();
		        PrintWriter writer= new PrintWriter(stringWriter);
		        t.printStackTrace(writer);
		        StringBuffer buffer= stringWriter.getBuffer();
		        return buffer.toString();
		} catch (Exception e) {
			return "$getTrace_ex";
		}
	       
	    }

}
